3.579 \(\int (c+d x^{-1+n}) (a+b x^n) \, dx\)

Optimal. Leaf size=41 \[ a c x+\frac {a d x^n}{n}+\frac {b c x^{n+1}}{n+1}+\frac {b d x^{2 n}}{2 n} \]

[Out]

a*c*x+a*d*x^n/n+1/2*b*d*x^(2*n)/n+b*c*x^(1+n)/(1+n)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {1891, 14} \[ a c x+\frac {a d x^n}{n}+\frac {b c x^{n+1}}{n+1}+\frac {b d x^{2 n}}{2 n} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x^(-1 + n))*(a + b*x^n),x]

[Out]

a*c*x + (a*d*x^n)/n + (b*d*x^(2*n))/(2*n) + (b*c*x^(1 + n))/(1 + n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 1891

Int[((A_) + (B_.)*(x_)^(m_.))*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Dist[A, Int[(a + b*x^n)^p, x], x] +
 Dist[B, Int[x^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, A, B, m, n, p}, x] && EqQ[m - n + 1, 0]

Rubi steps

\begin {align*} \int \left (c+d x^{-1+n}\right ) \left (a+b x^n\right ) \, dx &=c \int \left (a+b x^n\right ) \, dx+d \int x^{-1+n} \left (a+b x^n\right ) \, dx\\ &=a c x+\frac {b c x^{1+n}}{1+n}+d \int \left (a x^{-1+n}+b x^{-1+2 n}\right ) \, dx\\ &=a c x+\frac {a d x^n}{n}+\frac {b d x^{2 n}}{2 n}+\frac {b c x^{1+n}}{1+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 42, normalized size = 1.02 \[ \frac {2 a \left (c n x+d x^n\right )+b x^n \left (\frac {2 c n x}{n+1}+d x^n\right )}{2 n} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^(-1 + n))*(a + b*x^n),x]

[Out]

(2*a*(c*n*x + d*x^n) + b*x^n*((2*c*n*x)/(1 + n) + d*x^n))/(2*n)

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 56, normalized size = 1.37 \[ \frac {2 \, {\left (a c n^{2} + a c n\right )} x + {\left (b d n + b d\right )} x^{2 \, n} + 2 \, {\left (b c n x + a d n + a d\right )} x^{n}}{2 \, {\left (n^{2} + n\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="fricas")

[Out]

1/2*(2*(a*c*n^2 + a*c*n)*x + (b*d*n + b*d)*x^(2*n) + 2*(b*c*n*x + a*d*n + a*d)*x^n)/(n^2 + n)

________________________________________________________________________________________

giac [A]  time = 0.22, size = 65, normalized size = 1.59 \[ \frac {2 \, a c n^{2} x + 2 \, b c n x x^{n} + 2 \, a c n x + b d n x^{2 \, n} + 2 \, a d n x^{n} + b d x^{2 \, n} + 2 \, a d x^{n}}{2 \, {\left (n^{2} + n\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="giac")

[Out]

1/2*(2*a*c*n^2*x + 2*b*c*n*x*x^n + 2*a*c*n*x + b*d*n*x^(2*n) + 2*a*d*n*x^n + b*d*x^(2*n) + 2*a*d*x^n)/(n^2 + n
)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 45, normalized size = 1.10 \[ \frac {b c x \,{\mathrm e}^{n \ln \relax (x )}}{n +1}+a c x +\frac {a d \,{\mathrm e}^{n \ln \relax (x )}}{n}+\frac {b d \,{\mathrm e}^{2 n \ln \relax (x )}}{2 n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*x^(n-1))*(b*x^n+a),x)

[Out]

a*c*x+a*d/n*exp(n*ln(x))+b*c/(n+1)*x*exp(n*ln(x))+1/2*b*d/n*exp(n*ln(x))^2

________________________________________________________________________________________

maxima [A]  time = 1.29, size = 39, normalized size = 0.95 \[ a c x + \frac {b d x^{2 \, n}}{2 \, n} + \frac {b c x^{n + 1}}{n + 1} + \frac {a d x^{n}}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="maxima")

[Out]

a*c*x + 1/2*b*d*x^(2*n)/n + b*c*x^(n + 1)/(n + 1) + a*d*x^n/n

________________________________________________________________________________________

mupad [B]  time = 5.06, size = 38, normalized size = 0.93 \[ a\,c\,x+\frac {a\,d\,x^n}{n}+\frac {b\,d\,x^{2\,n}}{2\,n}+\frac {b\,c\,x\,x^n}{n+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x^(n - 1))*(a + b*x^n),x)

[Out]

a*c*x + (a*d*x^n)/n + (b*d*x^(2*n))/(2*n) + (b*c*x*x^n)/(n + 1)

________________________________________________________________________________________

sympy [A]  time = 2.03, size = 163, normalized size = 3.98 \[ \begin {cases} a c x - \frac {a d}{x} + b c \log {\relax (x )} - \frac {b d}{2 x^{2}} & \text {for}\: n = -1 \\\left (a + b\right ) \left (c x + d \log {\relax (x )}\right ) & \text {for}\: n = 0 \\\frac {2 a c n^{2} x}{2 n^{2} + 2 n} + \frac {2 a c n x}{2 n^{2} + 2 n} + \frac {2 a d n x^{n}}{2 n^{2} + 2 n} + \frac {2 a d x^{n}}{2 n^{2} + 2 n} + \frac {2 b c n x x^{n}}{2 n^{2} + 2 n} + \frac {b d n x^{2 n}}{2 n^{2} + 2 n} + \frac {b d x^{2 n}}{2 n^{2} + 2 n} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x**(-1+n))*(a+b*x**n),x)

[Out]

Piecewise((a*c*x - a*d/x + b*c*log(x) - b*d/(2*x**2), Eq(n, -1)), ((a + b)*(c*x + d*log(x)), Eq(n, 0)), (2*a*c
*n**2*x/(2*n**2 + 2*n) + 2*a*c*n*x/(2*n**2 + 2*n) + 2*a*d*n*x**n/(2*n**2 + 2*n) + 2*a*d*x**n/(2*n**2 + 2*n) +
2*b*c*n*x*x**n/(2*n**2 + 2*n) + b*d*n*x**(2*n)/(2*n**2 + 2*n) + b*d*x**(2*n)/(2*n**2 + 2*n), True))

________________________________________________________________________________________